class_name Damage


# 动作状态枚举
const ActionState = {
    "calcDamage":     "calcDamage", # 伤害计算
    "beCalcDamage":     "beCalcDamage", # 被伤害计算
    "damage":     "damage", # 伤害后
    "beDamage":     "beDamage", # 被伤害后
    "kill":     "kill", # 杀死
    "dead":     "dead" # 死亡
}

class DamageC:
	var _notify: Notify  #set from mutil
	var _id: int  #entity id
	const component_name := "DamageC"
	var buff
	var value
	var type	#伤害数值

	#{action: string, target: number};
	var action_target setget _set_action_target

	func _set_action_target(val):
		action_target = val
		if _notify:
			_notify.modify_event(_id, "action_target")


class BeDamageC:
	var _notify: Notify  #set from mutil
	var _id: int  #entity id
	const component_name := "BeDamageC"

	var buff
	var fighter		#攻击方
	var value		#伤害数值
	var type		#伤害类型， 如暴击
	var action setget _set_action

	func _set_action(val):
		action = val
		if _notify:
			_notify.modify_event(_id, "action")
